<template>

  <!-- 待收货订单结算 -->

  <Heaed title="订单结算" :left="true" :iconbool="false" @back="fun1"></Heaed>
  <div class="box1">


    <div class="img1">
      <img src="../../img/首页/u19.png" alt="" />
    </div>

    <div class="header">
      <OrderListContent></OrderListContent>
    </div>

    <div class="content">
      <p class="p11"><span class="sp1"></span> 收货人详情</p>
      <p>
        配送方式
        <label class="lab1"><input @click="fun(value)" class="la1" type="radio" name="Type" :value="'送货上门'"
            checked />送货上门</label>
        <label class="lab2"><input @click="fun(value1)" class="la2" type="radio" name="Type"
            :value1="'门店自取'" />门店自取</label>
      </p>
      <p v-show="val1 == '送货上门'">
        详细地址<input class="inp1" type="text" placeholder="小区,门牌" v-model="city" />
      </p>
      <p v-show="val1 == '送货上门'">
        联系人<input class="inp2" type="text" placeholder="输入真实姓名" v-model="man" />
      </p>
      <p v-show="val1 == '门店自取'">
        门店选择<input class="inp1" type="text" placeholder="小区,门牌" v-model="city" />
      </p>
      <p v-show="val1 == '门店自取'">
        取货人<input class="inp2" type="text" placeholder="输入真实姓名" v-model="man" />
      </p>
      <p>
        联系电话<input class="inp3" type="text" placeholder="输入手机号" v-model="phone" />
      </p>
      <p>
        备注<input class="inp4" type="text" placeholder="是否需要包装盒(非必填)" />
      </p>
      <p>配送费: <span class="sp2">20</span></p>
      <p>合计: <span class="sp3">{{ stores.itemData.gPrice * stores.itemData.number + 20 }}</span></p>
    </div>
    <div class="bottom">
      <van-button @click="fun2" round type="success" color="#5AEAD7">立即支付</van-button>
    </div>
  </div>
  <!-- 遮罩层 -->
  <div class="zheZ" v-show="show" @click="show = false">
    <div class="wrapper">信息没有完善</div>
  </div>

  <!-- 弹出层 -->
  <div class="tanC" v-show="showShare">
    <div class="chouT" :style="{ bottom: num }">
      <p class="p21">确认支付 <span @click="showShare = false">x</span></p>
      <p class="p31">400</p>
      <p class="p41">
        <b class="b1">订单信息:</b> 创意卫浴五件套 欧式高档卫生间洗漱.....
      </p>
      <p class="p51"><b class="b1">配送方式:</b> {{ val1 }}</p>
      <div class=" bottom1">
        <van-button @click="fun3" round type="success" size="small"  color="#2BCDDD"
          >立即支付</van-button
        >
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref, Transition } from "vue";
import OrderListContent from "./Mycomponents/OrderListContent.vue";
import { ExchangeInfo } from '../../stores/ExchangeOrder'
import { useRouter } from "vue-router";
import Heaed from "../../components/Hand.vue";


const stores = ExchangeInfo()
const router = useRouter();
const val1 = ref("送货上门");
const value = ref("送货上门");
const value1 = ref("门店自取");
const fun = (val) => {
  val1.value = val;
};

const fun1 = () => {
  router.go(-1);
};
const goOrderSuccess = () => {
  router.push("/OrderSucess");
};
// 支付功能
const city = ref("");
const man = ref("");
const phone = ref("");
// 遮罩层开关
const show = ref(false);

const ze = /\d{11}/;

// 弹出层
const num = ref(-190 + "px");
const showShare = ref(false);
const fun2 = (city1, man1, phone1) => {
  city1 = city.value;
  man1 = man.value;
  phone1 = phone.value;
  if (city1 !== "" && man1 !== "" && phone1 !== "" && ze.test( phone1 )) {
    showShare.value = true;
    num.value = 0 + "px";
  } else {
    show.value = true;
  }
};

const fun3 = () =>{
  router.push("/OrderSucess")
}
</script>

<style lang="less" scoped>
.img1 {
  position: absolute;
  top: 0px;
}
.header {
  position: relative;
  width: 90vw;
}
// 弹出层
.tanC {
  height: 120vh;
  width: 100vw;
  background-color: rgba(0, 0, 0, 0.4);
  position: absolute;
  top: 0px;
  left: 0px;
}

.chouT {
  width: 100vw;
  background-color: #ffffff;
  position: fixed;
  bottom: 0px;
  // transition:all 2s
  transition: all 2s linear;
}

.p21 {
  font-weight: 600;
  width: 100vw;
  text-align: center;
  height: 7vh;
  line-height: 7vh;
  border-bottom: 1px solid #e4e4e4;

  span {
    position: absolute;
    right: 20px;
  }
}

.bottom1 {
  width: 100vw;
  margin-top: 10px;

  button {
    width: 100%;
  }
}

.p31 {
  width: 100vw;
  font-size: 20px;
  color: #ff5e81;
  text-align: center;
  margin-top: 10px;
}

.p41,
.p51 {
  font-size: 12px;
  height: 5vh;
  line-height: 5vh;
  color: #666666;
  margin-left: 20px;

  .b1 {
    font-weight: 600;
    color: black;
    font-size: 14px;
  }
}

.box1 {
  height: 100vh;
  width: 100vw;
  background-color: #ecfdfa;
}

.bottom {
  position: fixed;
  bottom: 0px;
  width: 100vw;
  color: #fff;
  font-weight: 600;

  background-color: #ebfcf9;
  height: 7vh;

  button {
    width: 100%;
  }
}

.content {
  // padding-left: 9vw;
  text-indent: 7vw;
  width: 90vw;
  background-color: #fff;
  margin: 2.667vw auto;
  border-radius: 20px;
  overflow: auto;
  height: 60vh;

  p {
    margin: 20px 0px;
    font-weight: 600;
    input {
      margin-left: 20px;
      font-weight: 200;
      color: black;
      font-size: 12px;
      position: relative;
      right: -20px;
    }

    .inp2 {
      right: -36px;
    }

    .inp4 {
      right: -52px;
    }

    .sp1 {
      padding-left: 4vw;
      // margin-left: 6vw;
      position: relative;
      border-left: 1.11vw solid red;
      font-weight: bolder;
      // top: 2.333vw;
    }

    .sp2 {
      float: right;
      margin-right: 20px;
      color: #ff5e81;
    }

    .sp3 {
      float: right;
      margin-right: 20px;
      padding-bottom: 20px;
      color: #ff5e81;
    }
  }

  .p11 {
    line-height: 20px;
  }
}

.la1 {
  position: relative;
  left: -4px;
  top: 2px;
}

.la2 {
  position: relative;
  left: -4px;
  top: 2px;
}

.lab1 {
  font-weight: 600;
  // color: red;
  margin-left: 20px;
  font-size: 14px;
}
.lab2 {
  font-weight: 600;
  // color: red;
  font-size: 14px;
}

.beiJ {
  background-color: #3ed2e2;
  // position: absolute;
}

// 弹出层样式
.zheZ {
  width: 100vw;
  height: 120vh;
  background-color: rgba(0, 0, 0, 0.4);
  position: absolute;
  top: 0px;
  left: 0px;
}

.wrapper {
  position: fixed;
  top: 50%;
  left: 40%;
  height: 23.333vw;
  width: 23.333vw;
  z-index: 999;
  color: #fff;
  text-align: center;
  line-height: 23.333vw;
  background-color: rgba(0, 0, 0, 0.7);
  font-size: 12px;
  border-radius: 10px;
}

.block {
  width: 120px;
  height: 120px;
  background-color: rgba(0, 0, 0, 0.5);
}

// .background {
//   position: relative;
// }
.background {
  position: absolute;
  top: 0vw;
  left: 0;
}
</style>
